<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <!--router-link来指定跳转的路径-->
    <span><router-link to="/login">登录</router-link></span>
    <span><router-link to="/register">注册</router-link></span>
    <hr/>
    <div>
        <!--vue-router的锚点-->
        <router-view></router-view>
    </div>
</div>
</body>
<script src="../node_modules/vue/dist/vue.js"></script>
<script src="user/login.js"></script>
<script src="user/register.js"></script>
<script src="../node_modules/vue-router/dist/vue-router.js"></script>

<script type="text/javascript">
    const routes = [
        {path: '/login', component: login},
        {path: '/register', component: register}
    ]
    const router = new VueRouter({
        routes
    })
    var vm = new Vue({
        el: "#app",
        data:{

        },
        router
    })

</script>
</html>